#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=2e5+100;
typedef long long LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
LL dp[maxn],pre[maxn],ans[maxn];
struct P{
    LL val,id;
}a[maxn];
bool cmp(P A,P B){ return A.val<B.val; }
int main(void){
   	LL n;n=read();
   	for(LL i=1;i<=n;i++) a[i].val=read(),a[i].id=i;
    sort(a+1,a+1+n,cmp);
    memset(dp,0x3f,sizeof(dp));
    memset(pre,-1,sizeof(pre));
    dp[0]=0;
    dp[3]=a[3].val-a[1].val;
    for(LL i=4;i<=n;i++){
        for(LL k=i-3;k>=i-5;k--){
            if(k<0) continue;
            LL temp=dp[i];
            if(dp[i]>dp[k]+a[i].val-a[k+1].val){
                dp[i]=min(dp[i],dp[k]+a[i].val-a[k+1].val);
                if(temp>dp[i]){
                    pre[i]=k;
                }
            }
        }
    }
    LL x=n;LL tot=0;
    while(x>0){
        tot++;
        for(LL i=x;i>=max((LL)(1),pre[x]);i--){
            ans[a[i].id]=tot;
        }
        x=pre[x];
    }
    printf("%lld %lld\n",dp[n],tot);
    for(LL i=1;i<=n;i++){
        printf("%lld ",ans[i]);
    }
    printf("\n");
   	return 0;
}
